
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<title>发布内容 - FinalCMS Admin</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

<link rel="stylesheet" href="${ctx}/css/bootstrap.min.css" />
<link rel="stylesheet" href="${ctx}/css/font-awesome.min.css" />
<link rel="stylesheet" href="${ctx}/css/jquery-ui.custom.min.css" />
<link rel="stylesheet" href="${ctx}/css/fc-fonts.css" />
<link rel="stylesheet" href="${ctx}/css/fc.min.css" />
<link rel="stylesheet" href="${ctx}/css/jquery.gritter.css" />
<!--[if lte IE 9]>
	<link rel="stylesheet" href="${ctx}/css/fc-part2.min.css" />
<![endif]-->
<link rel="stylesheet" href="${ctx}/css/fc-skins.min.css" />
<link rel="stylesheet" href="${ctx}/css/fc-rtl.min.css" />

<!--[if lte IE 9]>
  <link rel="stylesheet" href="${ctx}/css/fc-ie.min.css" />
<![endif]-->

<!--[if lte IE 8]>
<script src="${ctx}/js/html5shiv.js"></script>
<script src="${ctx}/js/respond.min.js"></script>
<![endif]-->
</head>

<body class="no-skin">
<?include("../../inc/menu.html",{current:"post_article"}){}?>
<div class="main-content">
<div class="breadcrumbs" id="breadcrumbs">
	<script type="text/javascript">
		try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
	</script>

	<ul class="breadcrumb">
		<li><i class="ace-icon fa fa-home home-icon"></i> <a href="${ctx}/admin/index">首页</a>
		</li>
		<li class="active">发布内容</li>
	</ul>
	<div class="nav-search" id="nav-search">
		<form class="form-search">
			<span class="input-icon"> 
				<input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
				<i class="ace-icon fa fa-search nav-search-icon"></i>
			</span>
		</form>
	</div>
</div>

<div class="page-content">
	<?include("../../inc/function.html"){}?>
	<div class="page-header">
			<h1>发布内容 </h1>
		</div>
		<div class="row">
			<form action="${ctx}/admin/post/save" method="post" id="frm">
				<div class="col-xs-12">
					<div class="header green clearfix">
						<label for="title" class="col-sm-2 control-label" style="font-size:28px;">标题</label>
						<input data-toggle="tooltip" data-placement="top" title="标题不能为空" type="text" name="fPost.title" id="title" class="input-sm col-xs-10 tooltip-error" value="${post.title!}"/>
					</div>
					<div class="header green clearfix" style="border-bottom: 0px;">
						<label for="content_title" class="col-sm-2 control-label" style="font-size:28px;">类型</label>
						<select name="fPost.ftype" >
							<?for(f in ftype) {?><option value="${f.name}">${f.desc}</option><?}?>
						</select>
					</div>
					<div class="header green clearfix" style="border-bottom: 0px;">
						<label for="content_title" class="col-sm-2 control-label" style="font-size:28px;">栏目</label>
						<select name="fPost.category" >
						<?for(c in cats){?>
							<option value="${c.id}">${c.name}</option>
							<? if(c.sub != null) {?>
								<?for(c2 in c.sub){?>
								<option value="${c2.id}">----${c2.name}</option>
								<?}?>
							<?}?>
						<?}?>
						</select>
					</div>
					<div class="header green clearfix">
						<label for="content_title" class="col-sm-2 control-label" style="font-size:28px;">关键词</label>
						<input data-toggle="tooltip" data-placement="top" title="页面关键词" type="text" name="fPost.keyword" id="content_title" class="input-sm col-xs-10 tooltip-error" value="${post.keyword!}"/>
					</div>
					<div class="header green clearfix">
						<label for="content_title" class="col-sm-2 control-label" style="font-size:28px;">描述</label>
						<textarea name="fPost.desc" class="input-sm col-xs-10 tooltip-error">${post.describle!}</textarea>
					</div>							
					<input type="hidden" id="content" name="fPost.content">
					<script class="" id="editor" type="text/plain" style="height: 500px;">${post.content!}</script>
				</div>
				<br>
				<div class="" style="float: right;margin: 10px 15px 5px;">
					<button class="btn btn-info" type="button" id="sub">
						<i class="ace-icon fa fa-check bigger-110"></i>
						保存
					</button>
				</div>
			</form>
		</div>
	</div>
</div>  
<?include("../../inc/footer.html"){}?>
	
<script type="text/javascript" src='${ctx}/js/jquery1.11.0.min.js'></script>
<script type="text/javascript" src="${ctx}/js/bootstrap.min.js"></script>
<!--[if lte IE 8]>
<script type="text/javascript" src="${ctx}/js/excanvas.min.js"></script>
<![endif]-->

<script type="text/javascript" src="${ctx}/js/fc-extra.min.js"></script>
<script type="text/javascript" src="${ctx}/js/fc.min.js"></script>
<!-- 消息提示框插件 -->
<script type="text/javascript" src="${ctx}/js/jquery.gritter.min.js"></script>
<!-- 富文本编辑器插件 -->
<script type="text/javascript" charset="utf-8" src="${ctx}/ext/ueditor1_4_3/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="${ctx}/ext/ueditor1_4_3/ueditor.all.min.js"> </script>
<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="${ctx}/ext/ueditor1_4_3/lang/zh-cn/zh-cn.js"></script>

<script type="text/javascript">

	//实例化编辑器
	//建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
	var ue = UE.getEditor('editor');

	/**
	 * 提交文章	
	 */
	function sub() {
		if ($.trim($("#title").val()).length == 0) {
			$("#title").focus().tooltip("show");
			return false;
		}
		$("#content").val(ue.getContent());
		$("#frm").submit();
	}

	$("#sub").click(sub);
	if ('${msgStatus!}' != '' && '${msg!}' != '') {
		$.gritter.add({
			title : '' && 0 == '${msgStatus!}' ? '提示' : '警告',
			sticky : false, //提示框是否不消失
			text : '${msg!}',
			class_name : 'gritter-center '
					+ (0 == '${msgStatus!}' ? ' gritter-error'
							: ' gritter-success')
		});
	}
</script>
</body>
</html>
